//
// Created by zxh on 2020-4-28.
//

#ifndef ENVCTEL_COMMON_H
#define ENVCTEL_COMMON_H

#include <jni.h>
#include <android/log.h>

#define LOG_TAG "logfromc"

/*android 平台 :0x00 linux ：0x01*/
#define DEBUG_PLATFORM 0X00

/*调试平台 00 ：rk3399 01 :hi3798*/
#define  DEBUG_BOARD_ARCH_TYPE 0X00

/*tcp server enable flag*/
#define DEBUG_NETWORK_TCPSERVER_ENABLE 0x01

/*字符串调试打印开关*/
#define DEBUG_STRING_PRINTF_SWITCH_ENABLE 0X01

/*串口驱动打印输出标记*/
#define DEBUG_USB_SERIAL_PRINTF_ENBALE 0X01

#if DEBUG_PLATFORM == 0x00
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#elif DEBUG_PLATFORM == 0x01
#define LOGD(...) printf(...)
#define LOGI(...) printf(...)
#else
#define LOGD(...)   {}
#define LOGI(...)   {}
#endif

extern void CharArrayToHexString(char* pOut, const char* pInput, const int nInLen);
extern void LogOutHexString(char* data,int len);

#endif //ENVCTEL_COMMON_H
